#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>

int main()
{
	std::srand(std::time(0));
	int upper = 26;
	int n = 500;
	std::string s;
	for (int i = 0; i < n; i++) s += rand() % upper + 'a';
	std::cout << s << '\n';
	int m = 100;
	for (int i = 0; i < m; i++)
		std::cout << rand() % (n + 1) << '\n';
}

